package Tests;

import Model.Tile;
import Presenter.Map;
import junit.framework.TestCase;

public class TestGetTile extends TestCase {
	
	private Map makeMap() {
		Map map = new Map();
		map.setDefaultMap();
		return map;
	}
	
	/**
	 * test to see if getTile fails under invalid data type
	 */
	public void testGetTile1() {
		assertFalse("These two tiles are not equal",new Tile("2").equals(makeMap().getTile(2, 2)));

	}
	
	/**
	 * test to see if map is configured correctly - that is if the (1,5) tile is of M3 type
	 */
	public void testGetTile2() {
		assertFalse("These two tiles are not equal",new Tile("M3").equals(makeMap().getTile(1, 5)));
	}
	
	/**
	 * test to see if mpa is configured correctly - that is if the (0,0) tile is of M3 type
	 */
	public void testGetTile3() {
		assertFalse("These two tiles are not equal",new Tile("M3").equals(makeMap().getTile(0, 0)));
	}
	
	/**
	 * test to see if tiles that don't make up the map (i.e. are out of bounds) are unreachable
	 */
	public void testGetTile4() {
		assertNull("These two tiles are not equal",makeMap().getTile(1, -5));
	}
	
	/**
	 * test to see if tiles that don't make up the map (i.e. are out of bounds) are unreachable
	 */
	public void testGetTile5() {
		assertNull("These two tiles are not equal",makeMap().getTile(453456, 45454));
	}

}

